package dongbai.soft.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import dongbai.soft.dao.TransferDao;
import dongbai.soft.entity.TransferEntity;
import dongbai.soft.service.TransferService;
import dongbai.soft.utils.PageUtils;
import dongbai.soft.utils.Query;
import org.springframework.stereotype.Service;

import java.util.Map;


@Service("transferService")
public class TransferServiceImpl extends ServiceImpl<TransferDao, TransferEntity> implements TransferService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Map<String, Object> filter = (Map<String, Object>) params.get("filter");
        IPage<TransferEntity> page = this.page(
                new Query<TransferEntity>().getPage(params),
                new QueryWrapper<TransferEntity>().like("name", filter.get("name"))
                        .like("location", filter.get("location"))
        );

        return new PageUtils(page);
    }


}